 <?
if (!defined('baseinfo')) {
    exitdata();
}   
?>

<div class="subB clTxt1 fs05 clBg4">
    <div class="wrpSubB mainSB">
        <div class="ttlB cutTxt">Gamification</div>
    </div>
</div>

<div class="wrprGame">
    <div class="wrpTgHdGen clBd2 bdBtm clTxt2 fs05">
        <span class="tgHdGen tgCl clBd2 bdR clSp2" id="set-dshBrdGame" onclick="changetabgame('dshBrdGame')">Dashboard</span>
        <span class="tgHdGen tgCl clBd2 bdR" id="set-wrpAchvGame" onclick="changetabgame('wrpAchvGame')">Achievement</span>
        <span class="tgHdGen tgCl clBd2" id="set-hiwGame" onclick="changetabgame('hiwGame')">Rules</span>
    </div>
    <div class="wrpGame clearfix">
        <!-- dashboard -->
        <div class="dshBrdGame gametab">
            <div class="wrpGamePoint clBg5 fs07 clTxt1 clearfix">
                <div class="wrpOutGamePoint">
                    <div class="wrpInGamePoint clearfix">
                        <div class="gameLevelBadge">
                            <div class="levelBadge">
                                <img alt="" src="<? echo $data['myscore']['simg'];?>">
                            </div>
                        </div>
                        <div class="gamePoint">
                            <span class="levelNum fs09 boldGen"><? echo $data['myscore']['name'];?></span>
                            <span class="nameShopCrd fs04"><? echo $data['myscore']['exp'];?></span>
                            <span class="nameShopCrd fs04"><? echo $data['myscore']['point'];?></span>
                        </div>
                    </div>
                </div>
                <div class="nextLevel">
                    <span class="fs04 boldGen"><? echo $data['myscore']['shownow'];?></span>
                    <div class="wrpGamePgBar clBd2 bdFull clBg5">
                        <span class="pgBar clBgSp1" style="width: <? echo $data['myscore']['percent']; ?>;"></span>
                    </div>
                    <span class="fs04 boldGen"><? echo $data['myscore']['exp'];?> / <? echo $data['myscore']['nextlevel'];?></span>
                </div>
            </div>
            <div class="ldBrd">
                <div class="hdLdBrd clBg2">
                    <span class="fs07 clTxt2 boldGen">Leaderboard</span>
                </div>
                <div class="wrprGpy">
                    <div class="wrpHdGpy">
                        <div class="hdGpy clearfix">
                            <button id="setleader-all" class="btnGpy clBd2 bdFull fs05 clTxt2 tgHdGpy" onclick="changetableadergame('all')">All Players</button>
                            <button id="setleader-follower" class="btnGpy clBd2 bdFull fs05 clTxt2" onclick="changetableadergame('follower')">Followers</button>
                            <button id="setleader-following" class="btnGpy clBd2 bdFull fs05 clTxt2" onclick="changetableadergame('following')">Following</button>
                        </div>
                    </div>
                    <?
                    $krow=1;
                    if(count($data['leaderborad'])){
                        foreach($data['leaderborad'] as $keydata => $valuedata){?>
                    <div class="wrpGpy classkey-<?=$keydata?>" <?if($krow>1){?> style="display: none;" <?}$krow++;?>>
                        <?if(count($valuedata)){
                        foreach($valuedata as $valuedata2){?>
                        <div class="gpy">
                            <a href="<?=baseinfo?>/<?=$valuedata2['username']?>" class="agpy">
                                <img alt="img" src="<?=baseinfo.'/'.$valuedata2['imgpath']?>" class="gamePlayerImg">
                                <span class="gamePlayerName cutTxt clTxt2 fs03"><?=$valuedata2['displayname']?></span>
                                <span class="gamePlayerLevel clTxt2 fs03"><?=$valuedata2['name']?></span>
                            </a>
                        </div>
                      <?
                        }
                      }?>
                    </div>
                    <?
                        }
                    
                    }?>
                </div>
            </div>
            <div class="rcntAct">
                <div class="hdLdBrd clBg2">
                    <span class="fs07 clTxt2 boldGen">Recent Activity</span>
                </div>
                <div class="wrpRcntActLst">

                </div>
                <div class="pgActGame">
                    <!-- // PAGE NAVIGATION // -->
                </div>
            </div>
        </div>
        <!-- achivement -->
        <div class="wrpAchvGame gametab" style="display: none;">
            <div class="achvGame">
            <?if(count($data['badge'])){
                $k=1;
                foreach($data['badge'] as $valuebadge)
                {
            ?>
                <div class="wrpBdgeGame" onclick="openbadgepopup(<?=$k?>)">
                    <div class="bdgeBoxName">
                        <div class="bdgeBox">
                            <img alt="" src="<?=$valuebadge['img']?>">
                        </div>
                        <span class="bdgeName boldGen clTxt2 fs04"><?=$valuebadge['name']?></span>
                    </div>
                    <div class="wrpPopBadge" id="rowpopbadge-<?=$k?>">
                        <div class="popBadge clBg5">
                            <span class="fs03 clTxt2"><?=$valuebadge['desc']?></span>
                        </div>
                        <div class="triGame"></div>
                    </div>
                </div>
            <?
            $k++;
            }
            }?>
            </div>
        </div>
        <!-- Rules -->
        <div class="hiwGame gametab" style="display: none;">
            <div class="imgHiw">
                <img alt="img" src="<?=$data['ruleimg']?>">
            </div>
        </div>
    </div>
</div>
